<?php
require_once('lanceur_spip.php');


class TestBaliseSecureImageRefresh extends SpipTest {
    
    function testTagMustExist(){
		$code = '[(#SECURIMAGE_REFRESH|oui)ok]';                
        $this->assertOkCode($code);

	}		
        
	
    function testMustHaveLinkWithID(){
		$code = '#SECURIMAGE_REFRESH';
        $this->assertPatternCode('/^<a.*id="securimage_refresh_link"/', $code);
	}
    
    // #SECURIMAGE_REFRESH tag must insert code containing '<img' with 'id="securimage_refresh_image"'
    function testMustHaveImgWithID(){
		$code = '#SECURIMAGE_REFRESH';
        $this->assertPatternCode('/<img.*id="securimage_refresh_image"/', $code);
	}
    
    // #SECURIMAGE_REFRESH tag must insert code witch 'securimage/securimage_show.php' string in it
    function testMustHaveCodeWithPath() {
		$code = '#SECURIMAGE_REFRESH';
        $this->assertPatternCode('/securimage\/securimage_show_captcha\.php/', $code);
	}
}